// UpdateCallbackAgent.h

#ifndef __UPDATECALLBACKAGENT_H
#define __UPDATECALLBACKAGENT_H

#include "Common/Archive/UpdateCallback.h"
#include "IFolderArchive.h"

namespace Common
{
namespace Agent
{

class CUpdateCallbackAgent: public IUpdateCallbackUI
{
    // INTERFACE IUpdateCallbackUI 
  STDMETHOD(SetTotal)(UINT64 size) ;
  STDMETHOD(SetCompleted)(const UINT64 *completeValue) ;
  STDMETHOD(SetRatioInfo)(const UINT64 *inSize, const UINT64 *outSize) ;
  STDMETHOD(CheckBreak)() ;
  STDMETHOD(Finilize)() ;
  STDMETHOD(SetNumFiles)(UINT64 numFiles) ;
  STDMETHOD(GetStream)(const wchar_t *name, bool isAnti) ;
  STDMETHOD(OpenFileError)(const wchar_t *name, DWORD systemError) ;
  STDMETHOD(SetOperationResult)(INT32 operationResult) ;
  STDMETHOD(CryptoGetTextPassword2)(INT32 *passwordIsDefined, BSTR *password) ;
  STDMETHOD(CryptoGetTextPassword)(BSTR *password) ;
  /* STDMETHOD(ShowDeleteFile)(const wchar_t *name); */ 
  /* STDMETHOD(CloseProgress)() { return S_OK; }; */

  CComPtr<ICryptoGetTextPassword2> _cryptoGetTextPassword;
  CComPtr<IFolderArchiveUpdateCallback> Callback;
  CComPtr<ICompressProgressInfo> _compressProgress;
public:
  void SetCallback(IFolderArchiveUpdateCallback *callback);
};

}}

#endif
